<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>从结果集中获取下一行</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="pdostatement.execute.html">« PDOStatement::execute</a></li>
      <li style="float: right;"><a href="pdostatement.fetchall.html">PDOStatement::fetchAll »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.pdostatement.html">PDOStatement</a></li>
    <li>从结果集中获取下一行</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="pdostatement.fetch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDOStatement::fetch</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8, PECL pdo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">PDOStatement::fetch</span> &mdash; <span class="dc-title">
   从结果集中获取下一行
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-pdostatement.fetch-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>PDOStatement::fetch</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$fetch_style</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$cursor_orientation</code><span class="initializer"> = PDO::FETCH_ORI_NEXT</span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$cursor_offset</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>


  <p class="para rdfs-comment">
   从一个 PDOStatement 对象相关的结果集中获取下一行。<code class="parameter">fetch_style</code> 参数决定 POD 如何返回行。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-pdostatement.fetch-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">fetch_style</code></dt>

     <dd>

      <p class="para">
       控制下一行如何返回给调用者。此值必须是 <code class="literal">PDO::FETCH_*</code> 系列常量中的一个，缺省为 <code class="literal">PDO::ATTR_DEFAULT_FETCH_MODE</code> 的值 （默认为 <code class="literal">PDO::FETCH_BOTH</code> ）。
       <ul class="itemizedlist">
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_ASSOC</code>：返回一个索引为结果集列名的数组
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_BOTH</code>（默认）：返回一个索引为结果集列名和以0开始的列号的数组
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_BOUND</code>：返回 <strong><code>true</code></strong> ，并分配结果集中的列值给 <span class="function"><a href="pdostatement.bindcolumn.html" class="function">PDOStatement::bindColumn()</a></span> 方法绑定的 PHP 变量。
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_CLASS</code>：返回一个请求类的新实例，映射结果集中的列名到类中对应的属性名。如果 <code class="parameter">fetch_style</code> 包含 PDO::FETCH_CLASSTYPE（例如：<code class="literal">PDO::FETCH_CLASS |
         PDO::FETCH_CLASSTYPE</code>），则类名由第一列的值决定
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_INTO</code>：更新一个被请求类已存在的实例，映射结果集中的列到类中命名的属性
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_LAZY</code>：结合使用 <code class="literal">PDO::FETCH_BOTH</code> 和 <code class="literal">PDO::FETCH_OBJ</code>，创建供用来访问的对象变量名
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_NUM</code>：返回一个索引为以0开始的结果集列号的数组
        </p></li>
        <li class="listitem"><p class="para">
         <code class="literal">PDO::FETCH_OBJ</code>：返回一个属性名对应结果集列名的匿名对象
        </p></li>
       </ul>
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">cursor_orientation</code></dt>

     <dd>

      <p class="para">
       对于 一个 PDOStatement 对象表示的可滚动游标，该值决定了哪一行将被返回给调用者。此值必须是 <code class="literal">PDO::FETCH_ORI_*</code> 系列常量中的一个，默认为 <code class="literal">PDO::FETCH_ORI_NEXT</code>。要想让 PDOStatement 对象使用可滚动游标，必须在用 <span class="function"><a href="pdo.prepare.html" class="function">PDO::prepare()</a></span> 预处理SQL语句时，设置 <code class="literal">PDO::ATTR_CURSOR</code> 属性为 <code class="literal">PDO::CURSOR_SCROLL</code>。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">offset</code></dt>

     <dd>

      <p class="para"> 
       对于一个 <code class="literal">cursor_orientation</code> 参数设置为 <code class="literal">PDO::FETCH_ORI_ABS</code> 的PDOStatement 对象代表的可滚动游标，此值指定结果集中想要获取行的绝对行号。
      </p>
      <p class="para">
       对于一个 <code class="literal">cursor_orientation</code> 参数设置为 <code class="literal">PDO::FETCH_ORI_REL</code> 的PDOStatement 对象代表的可滚动游标，此值指定想要获取行相对于调用 <span class="function"><strong>PDOStatement::fetch()</strong></span> 前游标的位置
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-pdostatement.fetch-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   此函数（方法）成功时返回的值依赖于提取类型。在所有情况下，失败都返回 <strong><code>false</code></strong> 。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-pdostatement.fetch-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1071"><p><strong>示例 #1  使用不同的提取方式获取行</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$sth&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;name,&nbsp;colour&nbsp;FROM&nbsp;fruit"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$sth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;运用&nbsp;PDOStatement::fetch&nbsp;风格&nbsp;*/<br /></span><span style="color: #007700">print(</span><span style="color: #DD0000">"PDO::FETCH_ASSOC:&nbsp;"</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"Return&nbsp;next&nbsp;row&nbsp;as&nbsp;an&nbsp;array&nbsp;indexed&nbsp;by&nbsp;column&nbsp;name\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$sth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_ASSOC</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">);<br /><br />print(</span><span style="color: #DD0000">"PDO::FETCH_BOTH:&nbsp;"</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"Return&nbsp;next&nbsp;row&nbsp;as&nbsp;an&nbsp;array&nbsp;indexed&nbsp;by&nbsp;both&nbsp;column&nbsp;name&nbsp;and&nbsp;number\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$sth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_BOTH</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">);<br /><br />print(</span><span style="color: #DD0000">"PDO::FETCH_LAZY:&nbsp;"</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"Return&nbsp;next&nbsp;row&nbsp;as&nbsp;an&nbsp;anonymous&nbsp;object&nbsp;with&nbsp;column&nbsp;names&nbsp;as&nbsp;properties\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$sth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_LAZY</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">);<br /><br />print(</span><span style="color: #DD0000">"PDO::FETCH_OBJ:&nbsp;"</span><span style="color: #007700">);<br />print(</span><span style="color: #DD0000">"Return&nbsp;next&nbsp;row&nbsp;as&nbsp;an&nbsp;anonymous&nbsp;object&nbsp;with&nbsp;column&nbsp;names&nbsp;as&nbsp;properties\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$sth</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_OBJ</span><span style="color: #007700">);<br />print&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">NAME</span><span style="color: #007700">;<br />print(</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
PDO::FETCH_ASSOC: Return next row as an array indexed by column name
Array
(
    [NAME] =&gt; apple
    [COLOUR] =&gt; red
)

PDO::FETCH_BOTH: Return next row as an array indexed by both column name and number
Array
(
    [NAME] =&gt; banana
    [0] =&gt; banana
    [COLOUR] =&gt; yellow
    [1] =&gt; yellow
)

PDO::FETCH_LAZY: Return next row as an anonymous object with column names as properties
PDORow Object
(
    [NAME] =&gt; orange
    [COLOUR] =&gt; orange
)

PDO::FETCH_OBJ: Return next row as an anonymous object with column names as properties
kiwi
</pre></div>
    </div>
   </div>
   <div class="example" id="example-1072"><p><strong>示例 #2 使用一个可滚动游标获取行</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">readDataForwards</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'SELECT&nbsp;hand,&nbsp;won,&nbsp;bet&nbsp;FROM&nbsp;mynumbers&nbsp;ORDER&nbsp;BY&nbsp;BET'</span><span style="color: #007700">;<br />&nbsp;&nbsp;try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">ATTR_CURSOR&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">CURSOR_SCROLL</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_NUM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_ORI_NEXT</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\t"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\t"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;catch&nbsp;(</span><span style="color: #0000BB">PDOException&nbsp;$e</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMessage</span><span style="color: #007700">();<br />&nbsp;&nbsp;}<br />}<br />function&nbsp;</span><span style="color: #0000BB">readDataBackwards</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'SELECT&nbsp;hand,&nbsp;won,&nbsp;bet&nbsp;FROM&nbsp;mynumbers&nbsp;ORDER&nbsp;BY&nbsp;bet'</span><span style="color: #007700">;<br />&nbsp;&nbsp;try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">ATTR_CURSOR&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">CURSOR_SCROLL</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_NUM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_ORI_LAST</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;do&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\t"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\t"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_NUM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_ORI_PRIOR</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;catch&nbsp;(</span><span style="color: #0000BB">PDOException&nbsp;$e</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMessage</span><span style="color: #007700">();<br />&nbsp;&nbsp;}<br />}<br /><br />print&nbsp;</span><span style="color: #DD0000">"Reading&nbsp;forwards:\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">readDataForwards</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /><br />print&nbsp;</span><span style="color: #DD0000">"Reading&nbsp;backwards:\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">readDataBackwards</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Reading forwards:
21    10    5
16    0     5
19    20    10

Reading backwards:
19    20    10
16    0     5
21    10    5
</pre></div>
    </div>
   </div>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-pdostatement.fetch-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="pdo.prepare.html" class="function" rel="rdfs-seeAlso">PDO::prepare()</a> - 准备要执行的语句，并返回语句对象</span></li>
    <li class="member"><span class="function"><a href="pdostatement.execute.html" class="function" rel="rdfs-seeAlso">PDOStatement::execute()</a> - 执行一条预处理语句</span></li>
    <li class="member"><span class="function"><a href="pdostatement.fetchall.html" class="function" rel="rdfs-seeAlso">PDOStatement::fetchAll()</a> - 返回一个包含结果集中所有行的数组</span></li>
    <li class="member"><span class="function"><a href="pdostatement.fetchcolumn.html" class="function" rel="rdfs-seeAlso">PDOStatement::fetchColumn()</a> - 从结果集中的下一行返回单独的一列。</span></li>
    <li class="member"><span class="function"><a href="pdostatement.fetchobject.html" class="function" rel="rdfs-seeAlso">PDOStatement::fetchObject()</a> - 获取下一行并作为一个对象返回。</span></li>
    <li class="member"><span class="function"><a href="pdostatement.setfetchmode.html" class="function" rel="rdfs-seeAlso">PDOStatement::setFetchMode()</a> - 为语句设置默认的获取模式。</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>